﻿using OpenTools.Math;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Demo
{
    public partial class FormDemo : Form
    {
        public FormDemo()
        {
            InitializeComponent();
        }

        private void button_To10X_Click(object sender, EventArgs e)
        {
            try
            {
                label_Result.Text = MathBase.To10X(textBox_Value.Text.ToUpper(), Convert.ToInt32(textBox_Type.Text)).ToString();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void button_ToType_Click(object sender, EventArgs e)
        {
            try
            {
                label_Result.Text = MathBase.C10X_ToOthers(Convert.ToInt32(textBox_Value.Text), Convert.ToInt32(textBox_Type.Text)).ToString();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
    }
}
